package com.example.service.impl;

import com.example.service.OrderService;

public class OrderServiceImpl implements OrderService {
    @Override
    public boolean add(String pname, int number) {
        System.out.println("添加商品: " + pname + ", 数量: " + number);
        return true; // 模拟添加成功
    }

    @Override
    public boolean delete(String pname) {
        System.out.println("删除商品: " + pname);
        return true; // 模拟删除成功
    }

    @Override
    public int find(String pname) {
        // 模拟查询到的商品数量
        int count = (int) (Math.random() * 10) + 1;
        System.out.println("查询商品: " + pname + ", 数量: " + count);
        return count;
    }
}
